package com.person.jc.web.buy;

import java.util.List;
import java.util.Map;

import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Record;
import com.person.jc.service.buy.BsPartsOutlogService;
import com.person.jc.utils.Servlets;

/**
 * 业务配件出库
 */
//TODO 业务配件出库
public class BsPartsOutlogController extends Controller {
	
	public void init(){
		setAttr("menuId", getPara("menuId"));
		render("main.jsp");
	}
	
	public void list(){
		Map<String, Object> map = Servlets.getParametersStartingWith(getRequest(), "p_");
		List<Record> list = BsPartsOutlogService.me.getList(map);
		setAttr("list", list);
		render("list.jsp");
	}
	
	public void edit(){
		Map<String, Object> map = Servlets.getParametersStartingWith(getRequest(), "p_");
		List<Record> details = BsPartsOutlogService.me.getViewList(map);
		setAttr("details", details);
		render("edit.jsp");
	}
	
	
	public void viewParts(){
		String logId = getPara("logId");
		List<Record> list = BsPartsOutlogService.me.getViewParts(logId,"");
		setAttr("logId", logId);
		setAttr("list", list);
		render("viewParts.jsp");
	}
	
	
	public void save(){
		String orderId = getPara("orderId");
		BsPartsOutlogService.me.saveOutlog(orderId);
		renderText("success");
	}
}
